/*
 ============================================================================
 Name		: SAAppView.cpp
 Author	  : 
 Copyright   : Copyright (c)
 All rights reserved.
 Description : Application view implementation
 ============================================================================
 */

// INCLUDE FILES
#include <coemain.h>
#include "SAAppView.h"

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CSAAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CSAAppView* CSAAppView::NewL(const TRect& aRect)
{
    CSAAppView* self = CSAAppView::NewLC(aRect);
    CleanupStack::Pop(self);
    return self;
}

// -----------------------------------------------------------------------------
// CSAAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CSAAppView* CSAAppView::NewLC(const TRect& aRect)
{
    CSAAppView* self = new (ELeave) CSAAppView;
    CleanupStack::PushL(self);
    self->ConstructL(aRect);
    return self;
}

// -----------------------------------------------------------------------------
// CSAAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CSAAppView::ConstructL(const TRect& aRect)
{
    // Create a window for this application view
    CreateWindowL();

    // Set the windows size
    SetRect(aRect);

    // Activate the window, which makes it ready to be drawn
    ActivateL();
}

// -----------------------------------------------------------------------------
// CSAAppView::CSAAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CSAAppView::CSAAppView()
{
    // No implementation required
}

// -----------------------------------------------------------------------------
// CSAAppView::~CSAAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CSAAppView::~CSAAppView()
{
    // No implementation required
}

// -----------------------------------------------------------------------------
// CSAAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CSAAppView::Draw(const TRect& /*aRect*/) const
{
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Gets the control's extent
    TRect drawRect(Rect());

    // Clears the screen
    gc.Clear(drawRect);

}

// -----------------------------------------------------------------------------
// CSAAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CSAAppView::SizeChanged()
{
    DrawNow();
}

// -----------------------------------------------------------------------------
// CSAAppView::HandlePointerEventL()
// Called by framework to handle pointer touch events.
// Note: although this method is compatible with earlier SDKs, 
// it will not be called in SDKs without Touch support.
// -----------------------------------------------------------------------------
//
void CSAAppView::HandlePointerEventL(const TPointerEvent& aPointerEvent)
{

    // Call base class HandlePointerEventL()
    CCoeControl::HandlePointerEventL(aPointerEvent);
}

// End of File
